package com.heyu.cgsd.util;

public class AreaConvertUtils {
    private static final int M2 = 0;
    private static final int KM2 = 1;
    private static final int HA = 2;
    private static final int ARE = 3;
    private static final int DM2 = 4;
    private static final int CM2 = 5;
    private static final int MM2 = 6;
    private static final int UM2 = 7;
    private static final int ACRE = 8;
    private static final int MILE2 = 9;
    private static final int YD2 = 10;
    private static final int FT2 = 11;
    private static final int IN2 = 12;
    private static final int RD2 = 13;
    private static final int QING = 14;
    private static final int MU = 15;
    private static final int CHI2 = 16;
    private static final int CUN2 = 17;
    private static final int GONGLI2 = 18;

    private static double[] c = {1, 1000000, 10000, 100, 0.01, 0.0001, 0.000001, 0.000000000001,
            4046.856, 2589988.11, 0.83612736, 0.09290304, 0.00064516, 25.2928526, 66666.6667, 666.666667,
            0.111111111, 0.001111111, 1000000};

    public static double convert(double input, int srcUnit, int desUnit) {
        double result = input * c[srcUnit];

        return result / c[desUnit];
    }

    public static void main(String[] args) {
        double d = AreaConvertUtils.convert(1, M2, KM2);
    }
}
